package com.dfrz.stockMarket.web;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

import com.dfrz.stockMarket.bean.UserBean;
import com.dfrz.stockMarket.cons.Constants;

/**
 * 所有controller
 * @author Niko
 *
 */
public class BaseController extends HttpServlet {

	protected UserBean getSessionUserBean(HttpServletRequest request) {
		UserBean userBean = (UserBean) request.getSession().getAttribute(Constants.USER_CONTEXT);
		return userBean;
	}
	
	protected void setSession(HttpServletRequest request,String name,Object object){
		request.getSession().setAttribute(name, object);
	}
	
	
}
